<extend name="Layout:layout_content" />
<block name="body_main">
    <taglib name="Common\TagLib\Sohtml"/>    
    <form action="{:U('user_save')}" method="post" class="xsui-form" enctype="multipart/form-data">
        <fieldset>
            <div class="xsui-form-field">
                <label>字段名称：</label>
                <if condition="$data['field_name']">
                    {$data.field_name}
                    <else/>
                    <input type="text" name="field_name" placeholder="字段名称" value="{$data.field_name}" required="required" />
                </if>
            </div>
            <div class="xsui-form-field">
                <label>属性标题：</label>
                <input type="text" name="name" value="{$data.name}" placeholder="姓名"  required="required" />
            </div>
            <div class="xsui-form-field">
                <label>数据类型：</label>
                <sohtml:select name="type" required="required" items="C:字符;N:数字;T:文本;A:数组;E:枚举" />
            </div>
            <div class="xsui-form-field">
                <label>状态：</label>
                <sohtml:radio name="status" items="1:正常;0:禁用" value="{$data.status|default=1}" required="required" />
            </div>
        </fieldset>
        <button type="submit"><i class="fa fa-save"></i>保存</button>
        <input type="hidden" name="id" value="{$data.id}"/>
    </form>
    <a id="lnk-backward" class="xsui-hidden" href="{:U('attr_list','type_id='.$data['type_id'])}">返回</a>
</block>
<block name="body_after">
    <script type="text/javascript">
        FormPage.add_dialog_button(window, {
            text: "返回",
            icons: {primary: "fa fa-reply"},
            click: function () {
                location.href = $('#lnk-backward').attr('href');
            },
        });
    </script>
</block>